<%@tag pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="consignum" tagdir="/WEB-INF/tags"%>
<%@attribute name="id" type="java.lang.String"%>
<%@attribute name="label" type="java.lang.String"%>
<%@attribute name="placeholder"%>
<%@attribute name="styleClass" type="java.lang.String"%>
<%@attribute name="styleClassSection" type="java.lang.String"%>
<%@attribute name="style" type="java.lang.String"%>
<%@attribute name="maxlength" type="java.lang.String"%>
<%@attribute name="identifierMessage" type="java.lang.String"%>
<%@attribute name="tooltip" type="java.lang.String"%>
<%@attribute name="tooltipDirection" type="java.lang.String"%>
<%@attribute name="value" type="java.lang.Object"%>
<c:set scope="request" var="identifier" value="${identifierMessage}" />
<c:set scope="request" var="identifier" value="${identifierMessage}" />
<c:if test="${not empty requestScope.validacao.erros[identifier]}" var="withErrosOfValidation">
	<section <consignum:renderedField field="class" value="${styleClassSection}" defaultValue="col col-6" />>
	    <label class="labelConsignum">
		  <c:out value="${label}" default=" " />
		</label>

        <label class="input state-error">
			<input type="text" onkeypress="return dateMask(this, event);"
				<consignum:renderedField field="placeholder" value="${placeholder}" /> 
				<consignum:renderedField field="maxlength" value="${maxlength}" />
				<consignum:renderedField field="class" value="${styleClass}" /> 
				<consignum:renderedField field="id" value="${id}" /> 
				<consignum:renderedField field="name" value="${id}" />
				<c:if test="${not empty tooltip}">
					<consignum:renderedField field="rel" value="tooltip" />
					<consignum:renderedField field="data-placement" value="${tooltipDirection}" defaultValue="top" />
					<consignum:renderedField field="data-original-title" value="${tooltip}" />
					<consignum:renderedField field="lang" value="tooltip" />
				</c:if>
				<consignum:renderedField field="value" value="${fn:trim(value)}" /> 
				<consignum:renderedField field="style" value="${style}" defaultValue="border-radius: 4px;"/> />
		</label>
		<div class="note note-error">
			<label class="labelConsignumMessage"><c:out value="${requestScope.validacao.erros[identifier]}" default=" " /></label>
		</div>
	</section>
</c:if>
<c:if test="${not withErrosOfValidation}">
	<section <consignum:renderedField field="class" value="${styleClassSection}" defaultValue="col col-6" />>
		 <label class="labelConsignum"> <c:out value="${label}" default=" " /></label> 
		<label class="input"> 
		 <input type="text"  onkeypress="return dateMask(this, event);"
			<consignum:renderedField field="placeholder" value="${placeholder}" /> 
			<consignum:renderedField field="maxlength" value="${maxlength}" />
			<consignum:renderedField field="class" value="${styleClass}" />
			<consignum:renderedField field="id" value="${id}" /> 
			<consignum:renderedField field="name" value="${id}" />
			<c:if test="${not empty tooltip}">
					<consignum:renderedField field="rel" value="tooltip" />
					<consignum:renderedField field="data-placement" value="${tooltipDirection}" defaultValue="top" />
					<consignum:renderedField field="data-original-title" value="${tooltip}" />
					<consignum:renderedField field="lang" value="tooltip" />
				</c:if>
			<consignum:renderedField field="value" value="${fn:trim(value)}" /> 
			<consignum:renderedField field="style" value="${style}" defaultValue="border-radius: 4px;"/> />
		</label>
	</section>
</c:if>


